#include ("/_includes/_layout.html")
#@layout("参团", "wxmall,点步科技", "Wxmall社区","wxmall")
#define css()
<style>
.weui-panel:after, .weui-panel:before{
content : none !important;
)
.weui-btn-area{
    margin: 0.17647059em 15px .3em !important;
)
</style>
#end
#define content()
<div class="weui-panel weui-panel_access">
  <div class="weui-panel__hd">拼团商品</div>
  <div class="weui-panel__bd">
    <div class="weui-media-box weui-media-box_appmsg">
      <div class="weui-media-box__hd">
      	#if( groupingInfo?? && groupingInfo.isGrouped?? && groupingInfo.isGrouped==true)
			<a href="#(webctx)/product/detail/?id=#(product.id??)"><img class="weui-media-box__thumb" src="#(img_domain??)#(product.image??)" alt=""/></a>
		#elseif( groupingInfo?? && groupingInfo.isExpires?? && groupingInfo.isExpires==true)
			<a href="#(webctx)/product/detail/?id=#(product.id??)"><img class="weui-media-box__thumb" src="#(img_domain??)#(product.image??)" alt=""/></a>
		#else
			<a href="#(webctx)/product/detail/?id=#(product.id??)&gheaderUserId=#(groupingInfo.groupHeaderId??)"><img class="weui-media-box__thumb" src="#(img_domain??)#(product.image??)" alt=""/></a>
		#end
      </div>
      <div class="weui-media-box__bd">
        <h4 class="weui-media-box__title">
        #if( groupingInfo?? && groupingInfo.isGrouped?? && groupingInfo.isGrouped==true)
			<a href="#(webctx)/product/detail/?id=#(product.id)">#(product.name)</a>
		#elseif( groupingInfo?? && groupingInfo.isExpires?? && groupingInfo.isExpires==true)
			<a href="#(webctx)/product/detail/?id=#(product.id??)">#(product.name)</a>
		#else
			<a href="#(webctx)/product/detail/?id=#(product.id??)&gheaderUserId=#(groupingInfo.groupHeaderId??)">#(product.name??)</a>
		#end
        </h4>
        <p class="price weui-media-box__desc">#(groupInfo.collagePrice??)</p>
        <p class="weui-media-box__desc">#(groupInfo.groupNum??)</p>    
      </div>
    </div>
  </div>
</div>
#if( groupingInfo?? && groupingInfo.groupUsers?? && groupingInfo.groupUsers.size()>0)
<div class="weui-panel">
   <div class="weui-panel__bd">
     <div class="weui-media-box weui-media-box_text">
     	<div>
		<span class="weui-media-box__title" style="font-size: 14px;color: gray;">#(groupingInfo.groupHeader??)的团,还差#(groupingInfo.diffUserCount??)人成团</span>
		<ul class="weui-media-box__info">
			#for( guser : groupingInfo.groupUsers)
				<li class="weui-media-box__info__meta"><img style="width:40px; height:40px; border-radius:50%; overflow:hidden;" alt="#(guser.nickName??)" src="#(guser.headimg??)"><p>#(guser.nickName??)</p></li>
			#end
		</ul>
		</div>          	
     </div>
   </div>
</div>          
#end
#if( groupingInfo?? && groupingInfo.isExpires?? && groupingInfo.isExpires==false)
	<div class="weui-btn-area">
		<span class="timer" style="color: red">
			<span></span>天<span></span>小时<span></span>分<span></span>秒
		</span>
		<input id="db_end_timestamp" type="hidden" value="#(groupingInfo.expiresIn )"/>
	</div>   
#end

#if( groupingInfo?? && groupingInfo.isGrouped?? && groupingInfo.isGrouped==true)
	<p class="weui-btn-area"><a href="javascript:void(0);" class="weui-btn weui-btn_primary to-show">邀请加团</a></p>
#elseif( groupingInfo?? && groupingInfo.isExpires?? && groupingInfo.isExpires==true)
	<p class="weui-btn-area"><a href="#(webctx)/product/detail/?id=#(product.id??)" class="weui-btn weui-btn_primary">立即开团</a></p>
#else
	<p class="weui-btn-area"><a href="#(webctx)/product/detail/?id=#(product.id??)&groupId=#(groupingInfo.groupId??)" class="weui-btn weui-btn_primary">立即参团</a></p>
#end
<!-- <p class="weui-btn-area">
  <a href="javascript:void(0);" class="weui-btn weui-btn_primary">立即参团</a>
</p> -->
<!--手机端script需要加载后方-->
#end
<script type="text/javascript" src="#(webctx)/resources/js/timer2.js"></script>
<script type="text/javascript">
//去分享
$(".to-show").click(function(){
	showMsg("点击右上角分享");
});

wx.ready(function(){
	//自定义“分享给朋友”及“分享到QQ”按钮的分享内容（1.4.0） #(session._buyerUser.open_id)
	wx.updateAppMessageShareData({ 
	    title: '#(session._buyerUser.nickname??)邀请你来拼团，开团了！', // 分享标题
	    desc: '#(product.name??)开团了！开团了', // 分享描述
	    link: '#(webctx)/product/detail/?id=#(product.id??)&groupId=#(groupingInfo.groupId??)', // 分享链接
	    imgUrl: '#(img_domain??)#(product.image??)', // 分享图标
        success: function () {
        	// 设置成功
        }
	})
	
	//自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容（1.4.0）
	wx.updateTimelineShareData({ 
	    title: '#(session._buyerUser.nickname??)邀请你来拼团，开团了！', // 分享标题
	    link: '#(webctx)/product/detail/?id=#(product.id??)&groupId=#(groupingInfo.groupId??)', // 分享链接
	    imgUrl: '#(img_domain??)#(product.image??)', // 分享图标
        success: function () {
          // 设置成功
        }
	});
})

</script>

